Simulation of the Ising model